# -*- coding: utf-8 -*-
from Cookie import SimpleCookie as cookie

def add_cookie(cookie, out):
	out.headers.add_header('Set-Cookie', cookie.output('','',','))

def get_cookie(request):
	try:
		return cookie(request.headers['Cookie'])
	except KeyError:
		return cookie()
